<?php

declare (strict_types = 1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

Router::post('/login', 'App\Controller\IndexController@login');
Router::post('/regist', 'App\Controller\IndexController@regist');

Router::addGroup('', function () {
    Router::get('/userinfo', 'App\Controller\IndexController@getUserInfoById');
    Router::get('/my', 'App\Controller\IndexController@getUserInfoWithToken');
    Router::get('/userlist', 'App\Controller\IndexController@userList');
    Router::put('/user', 'App\Controller\IndexController@updateUser');
    Router::post('/logout', 'App\Controller\IndexController@logout');
    Router::post('/refreshToken', 'App\Controller\IndexController@refreshToken');
    Router::post('/user', 'App\Controller\IndexController@addUser');
    Router::delete('/user', 'App\Controller\IndexController@deleteUser');
}, [
    'middleware' => [Tbqphplib\Hyperfbase\JwtAuthMiddleware::class],
]);
